package com.tbit.uqbike.constant.enums;

/**
 * @Author HZW
 * @ClassName RechargeType
 * @Description
 * @date 2022/5/4 18:51
 * @Version 1.0
 */
public enum RechargeType {
    DISPATCH_PARK(1, "微信app"),
    DISPATCH_NOT_PARK(2, "微信小程序"),
    DISPATCH_NOT_IN_AREA(3, "支付app"),
    DISPATCH_NO_IN_PARK(4, "微信支付分"),
    DISPATCH_HELMET(5, "支付宝小程序"),
    DISPATCH_RUN(6, "海外app支付"),
    DISPATCH_NO_CARSTATUS(7, "汇付聚合微信支付"),
    DISPATCH_VERTICAL(8, "汇付聚合支付宝支付"),
    DISPATCH_BLE(9, "中科微信小程序"),
    DISPATCH_RFID(10, "中科支付宝小程序"),
    ;

    private int index;
    private String desc;

    RechargeType(int index, String desc) {
        this.index = index;
        this.desc = desc;
    }

    public static RechargeType of(int orderStatus) {
        for (RechargeType temp : RechargeType.values()) {
            if (temp.getIndex() == orderStatus) {
                return temp;
            }
        }
        return null;
    }

    public int getIndex() {
        return index;
    }

    public String getDesc() {
        return desc;
    }
}
